Skip to content

Conversation

@amir-ghasemi
Copy link
Collaborator

No description provided.

…d AI-assisted prompt template builder. Also supports prompt version historyand ability to restore older prompts.

- Implement AI-assisted prompt builder using LLM for template generation (uses liteLLM and LLM_SERVICE_GENERAL_MODEL_NAME env variable)
- Add version history with restore functionality
- Support variable placeholders ({{variable_name}}) in prompts
- Enable prompt editing with automatic version creation
- Include search functionality and empty states
- Add VariableDialog for filling prompt variables before use

Backend:
- Add PromptBuilderAssistant service with LiteLLM integration
- Update PATCH endpoint to create new versions on prompt text changes
- Add version management endpoints (list, restore)
- Update DTOs to support prompt text updates
- Add category filter dropdown next to search bar with Filter icon
- Support multiselect with checkboxes for multiple categories
- Show selected count badge and "Clear all" button
- Filter prompts by both search query AND selected categories
- Add promptLibrary flag (requires SQL persistence, defaults to true)
- Add promptAIAssisted flag (requires LLM config, auto-disabled if missing)
- Add promptVersionHistory flag (defaults to true)
- Add promptSharing placeholder flag in the backend (future feature, defaults to false)
- Conditionally show Prompts navigation based on promptLibrary flag
- Disable AI-Assisted button when LLM not configured
- Hide version history buttons when feature disabled
- Auto-disable prompts if session_service is not SQL
- Explicitly set false values for disabled features

Backend: config.py checks SQL requirement and LLM availability
Frontend: App.tsx, CreatePromptCard, PromptDisplayCard respect flags
- Add 10 declarative YAML tests for prompts endpoints (all passing)
- Fix Alembic migration for SQLite/PostgreSQL compatibility
- Use batch_alter_table for cross-database foreign key support
- Add pytest markers: prompts, versioning, search, projects, crud, validation, error

Tests cover:
- CRUD operations (create, read, update, delete)
- Version management (version creation)
- Validation (duplicate command rejection)
- Search and filtering (search, category filter)
- Error handling (404 responses)

Migration fix:
- Create prompts table first (no circular dependency)
- Use batch_alter_table for adding foreign keys (SQLite-safe)
- Compatible with SQLite (copy-move) and PostgreSQL (ALTER TABLE)

Run tests: python -m pytest tests/integration/scenarios_declarative/ -m prompts -v
- Add two-option dialog for large text pastes (≥300 chars or ≥10 lines)
- Implement "Paste as Text" to create numbered badges in chat input
- Implement "Save as Artifact" to upload text as session artifact
- Add auto-detection for file types (Python, JS, TS, JSON, YAML, etc.)
- Add dynamic title generation based on detected file type
- Support session creation on artifact upload for new chats
- Add PastedTextBadge component with preview and view dialog
- Add PasteActionDialog with file type selector and content preview
- Update ChatInputArea to handle paste interception and artifact upload
…isibility

- Fix HTTP exception handler to pass through specific error details
- Replace alert() with addNotification() in PromptsPage for consistency
- Update error handling to support both EventErrorDTO and legacy formats
- Add success notifications for create, update, and restore operations

Fixes duplicate command error showing generic "Failed to create prompt"
instead of "Command already exists"
…t dialog

Added optional description field for artifact metadata
Implemented two-step overwrite confirmation for duplicate filenames
Button text changes: "Confirm Overwrite" → "Overwrite & Save"
Confirmation resets when filename changes
- Add text selection detection for AI messages only
- Implement context menu with Summarize, Explain, Custom, and Copy actions
- Auto-submit quick actions (Summarize/Explain) with selected text as context
- Add inline custom question input with auto-submit
- Skip paste choice dialog, go directly to artifact creation form
- Auto-generate filename with detected extension and concise description
- Prevent text selection on filename input focus
- Display badge for created artifacts in chat input area
- Fix badge persistence when session is created from artifact upload
- Shorten auto-generated description preview to 50 chars
Enable clicking pasted artifact badges to open and preview the artifact in the Files panel.
…d improved onboarding

- Convert AI builder from dialog to full-page view with left/right panel layout
- Add intermediate "Generate a prompt" dialog for initial task description
- Center empty state prompt card and hide search when library is empty
- Update button text to active language ("Build with AI", "Create Manually")
- Remove Bot/User avatars from chat and match main chat styling
- Add clear variable explanation with user-friendly wording
- Increase highlight duration for updated sections (3s → 5s)
- Remove presumptive "Ready to Save" indicators
- Reduce spacing between card headers and content
- Align headers between chat and preview panels
- Remove max-width constraint when custom input is shown
- Move submit button inside input field as inline icon
…at sessions

- Add reserved /create-template command in chat slash menu
- Capture and format session history when command is invoked
- Navigate to AI prompt builder with conversation context
- Auto-submit conversation to AI for template analysis
- Increase backend message limit to 200k chars for long conversations
- Auto-scroll to bottom when loading conversation history
- Only show command when session has user messages
Copy link
Collaborator

@RohanSreelesh RohanSreelesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the backend

- Add model config reference to webui gateway config
- Update config.py to retrieve LLM settings from component.get_config()
- Update PromptBuilderAssistant to require model_config parameter
- Update prompt router endpoints to pass model config
- Remove environment variable fallbacks in favor of config-only approach
Copy link
Collaborator

@RohanSreelesh RohanSreelesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backend looks good just one more additional change is needed for the template.

@github-actions
Copy link

github-actions bot commented Nov 10, 2025

WhiteSource Policy Violation Summary

✅︎ No Blocking Whitesource Policy Violations found in solaceai/solace-agent-mesh-ui-pr-517!

@sonarqube-solacecloud
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 70%)
5.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants